﻿<?php
session_start();
require_once('basic.class.php');
$vote = new Vote();
$vote->judgeLogin();

$listMonitor = $vote->listInfo('班长');
$listLearn = $vote->listInfo('学习委员');
$listParty = $vote->listInfo('团支书');
$listLife = $vote->listInfo('生活委员');
$listZuzhi = $vote->listInfo('组织委员');
$listPe = $vote->listInfo('体育委员');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" /><!--如果是IE8时强制以IE7显示-->
<meta name="keywords" content=""><!--SEO关键字-->
<meta name="description" content=""><!--SEO描述-->
<link rel="shortcut icon" type="image/ico" href="images/favicon.ico"><!--选项卡图标-->
<title>湖南农业大学工学院09汽车一班班委竞选投票活动</title>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/common.css">
<link rel="stylesheet" href="css/style.css">
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<!--[if ie]>
<link rel="stylesheet" href="css/ie.css">
<script type="text/javascript" src="js/DD_belatedPNG.js" ></script>
<script type="text/javascript">
DD_belatedPNG.fix('.png');/*在需要png透明的元素里面加上.png样式即可（class="png"）*/
</script>
<![endif]-->
</head>
<body>

	<div class="header h100"><!-- header -->
		<div class="w960 bc">
			<p style="font-size:40px">湖南农业大学工学院09汽车一班班委竞选投票活动</p>
			<ul class="header_function fr mr10 f18 tc">
			</ul>
		</div>
	</div><!-- end_header -->
	
	<div class="main w960 bc oh"><!-- main -->
		<div class="i_h_content fl mr20 ml10"><!-- left_content -->
			<span style="font-size:18px">学号：<?php echo $_SESSION['user_account'];?> &nbsp;&nbsp;<a href="bbs.php" style="color:blue;font-size:18px;">我要推荐候选人</a>&nbsp;&nbsp;<a href="logOut.php" style="color:blue;font-size:18px;">退出</a></span>
			<div class="i_h_content_top img png"></div>

			<div class="article oh h"><!-- 每篇博文 -->
				<div class="article_right fr w500">
					<p class="article_title f22 mt20">班长候选人：</p>
					<div class="article_text mt20">
						<p class="ajaxReplace">
			<?php foreach($listMonitor as $key => $value): ?>
						<span style="margin-left:25px;font-size:20px;"><?php echo $value['name']; ?></span>&nbsp;&nbsp;
<?php
$flag = $vote->judgeVoted('班长');
if($flag == 0):
?>
<button class="button">支持<?php echo $value['name'];?></button>
<?php else: ?>
<span class='button' style='color:red; font-size:18px;'>获得<?php echo $value['total_num']; ?>票</span>
<?php endif; ?>

	<input type="hidden" value="<?php echo $value['id']; ?>" class="hiddenId">
		<input type="hidden" value="<?php echo $value['position_name']; ?>" class="hiddenPN"
>		<?php endforeach; ?>	
						</p>
					</div>
				</div>


					<div class="article_bot oh f12 mt20">
					</div>
				</div><!--E every article-->

			<div class="article oh h"><!-- 每篇博文 -->
				<div class="article_right fr w500">
					<p class="article_title f22 mt20">团支书候选人：</p>
					<div class="article_text mt20">
						<p class='ajaxReplace'>
			<?php foreach($listParty as $key => $value): ?>
						<span style="margin-left:25px;font-size:20px;"><?php echo $value['name']; ?></span>&nbsp;&nbsp;
<?php 
$flag = $vote->judgeVoted('团支书');
if($flag == 0):?>
<button class="button">支持<?php echo $value['name'];?></button>
<?php else: ?>
<span class='button' style='color:red; font-size:18px;'>获得<?php echo $value['total_num']; ?>票</span>
<?php endif; ?>

		<input type="hidden" value="<?php echo $value['position_name']; ?>" class="hiddenPN"
><input type="hidden" value="<?php echo $value['id']; ?>" class="hiddenId">
			<?php endforeach; ?>	
						</p>
					</div>
				</div>

					<div class="article_bot oh f12 mt20">
					</div>
				</div><!--E every article-->
	
			<div class="article oh h"><!-- 每篇博文 -->
				<div class="article_right fr w500">
					<p class="article_title f22 mt20">学习委员候选人：</p>
					<div class="article_text mt20">
						<p class="ajaxReplace">
			<?php foreach($listLearn as $key => $value): ?>
						<span style="margin-left:25px;font-size:20px;"><?php echo $value['name']; ?></span>&nbsp;&nbsp;

<?php 
$flag = $vote->judgeVoted('学习委员');	
if($flag == 0):?>
<button class="button">支持<?php echo $value['name'];?></button>
<?php else: ?>
<span class='button' style='color:red; font-size:18px;'>获得<?php echo $value['total_num']; ?>票</span>
<?php endif; ?>

	<input type="hidden" value="<?php echo $value['id']; ?>" class="hiddenId">
		<input type="hidden" value="<?php echo $value['position_name']; ?>" class="hiddenPN"
>		<?php endforeach; ?>	
						</p>
					</div>
				</div>

					<div class="article_bot oh f12 mt20">
					</div>
				</div><!--E every article-->
			
		
			<div class="article oh h"><!-- 每篇博文 -->
				<div class="article_right fr w500">
					<p class="article_title f22 mt20">体育委员候选人：</p>
					<div class="article_text mt20">
						<p class='ajaxReplace'>
			<?php foreach($listPe as $key => $value): ?>
						<span style="margin-left:25px;font-size:20px;"><?php echo $value['name']; ?></span>&nbsp;&nbsp;
<?php 
$flag = $vote->judgeVoted('体育委员');	
if($flag == 0):?>
<button class="button">支持<?php echo $value['name'];?></button>
<?php else: ?>
<span class='button' style='color:red; font-size:18px;'>获得<?php echo $value['total_num']; ?>票</span>
<?php endif; ?>

	<input type="hidden" value="<?php echo $value['id']; ?>" class="hiddenId">
		<input type="hidden" value="<?php echo $value['position_name']; ?>" class="hiddenPN">	
	<?php endforeach; ?>	
						</p>
					</div>
				</div>

					<div class="article_bot oh f12 mt20">
					</div>
				</div><!--E every article-->
			
			
			
			<div class="article oh h"><!-- 每篇博文 -->
				<div class="article_right fr w500">
					<p class="article_title f22 mt20">组织委员候选人：</p>
					<div class="article_text mt20">
						<p class='ajaxReplace'>
			<?php foreach($listZuzhi as $key => $value): ?>
						<span style="margin-left:25px;font-size:20px;"><?php echo $value['name']; ?></span>&nbsp;&nbsp;
<?php 
$flag = $vote->judgeVoted('组织委员');	
if($flag == 0):?>
<button class="button">支持<?php echo $value['name'];?></button>
<?php else: ?>
<span class='button' style='color:red; font-size:18px;'>获得<?php echo $value['total_num']; ?>票</span>
<?php endif; ?>

		<input type="hidden" value="<?php echo $value['position_name']; ?>" class="hiddenPN">
<input type="hidden" value="<?php echo $value['id']; ?>" class="hiddenId">
			<?php endforeach; ?>	
						</p>
					</div>
				</div>

					<div class="article_bot oh f12 mt20">
					</div>
				</div><!--E every article-->
			
			
			<div class="article oh h"><!-- 每篇博文 -->
				<div class="article_right fr w500">
					<p class="article_title f22 mt20">生活委员候选人：</p>
					<div class="article_text mt20">
						<p class='ajaxReplace'>
			<?php foreach($listLife as $key => $value): ?>
						<span style="margin-left:25px;font-size:20px;"><?php echo $value['name']; ?></span>&nbsp;&nbsp;
<?php
  $flag = $vote->judgeVoted('生活委员'); 
	if($flag == 0):?>
<button class="button">支持<?php echo $value['name'];?></button>
<?php else: ?>
<span class='button' style='color:red; font-size:18px;'>获得<?php echo $value['total_num']; ?>票</span>
<?php endif; ?>

	<input type="hidden" value="<?php echo $value['id']; ?>" class="hiddenId">
	<input type="hidden" value="<?php echo $value['position_name']; ?>" class="hiddenPN">
			<?php endforeach; ?>	
						</p>
					</div>
				</div>

					<div class="article_bot oh f12 mt20">
					</div>
				</div><!--E every article-->
			
		

			<div class="i_h_content_bot img png"></div>
		</div><!-- end_left_content -->
		
		<div class="i_h_sider fl ml10"><!-- right_sider -->
			<ul class="recommends mt20 oh">
			<li>还有以下同学未投票，请赶快投上你宝贵的一票</li>
			<?php 
				foreach($vote->voteCount() as $v):
			?>
				<li><?php echo $v['user_account']; ?></li>
			<?php
			endforeach;
			?>
			</ul>
		</div><!-- end_right_sider -->
	</div><!-- end_main -->
	
	<div class="footer w960 bc pb20 mt20">
		<p class="copyright b4 ml10">&copy; 2012 author:zhouyi <a href="www.yitingforever.com">about me</a></p>
	</div>
	
</body>
</html>
